home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: Passing structures--related Q
- Date: 22 Feb 1996 23:31:09 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb22163109@qcd.lanl.gov>
- References: <17735D030S86.JJSTEP00@ukcc.uky.edu>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: JJSTEP00@ukcc.uky.edu's message of Thu, 22 Feb 96 14:48:16 EST
-
- Path: newshost.lanl.gov!ncar!gatech!ukma!ukcc.uky.edu!JJSTEP00
- From: JJSTEP00@ukcc.uky.edu (Jason Stephenson)
- Newsgroups: comp.lang.c
- Subject: Passing structures--related Q
- Date: Thu, 22 Feb 96 14:48:16 EST
- Organization: The University of Kentucky
- Lines: 17
- Message-ID: <17735D030S86.JJSTEP00@ukcc.uky.edu>
- NNTP-Posting-Host: ukcc.uky.edu
-
- In article <17735D030S86.JJSTEP00@ukcc.uky.edu>
- JJSTEP00@ukcc.uky.edu (Jason Stephenson) writes:
- <snip>
- JJS: /* code */
- JJS: some_func({x, y});
- JJS: /* more code */
- JJS:
- JJS: What I'm trying to figure out is, can you replace a struct with
- its values?
-
- No. In C, no instances of unnamed composite types exist. (Actually,
- there are two exceptions depending on your point of view: first, if x
- is a pointer to a composite type, *x is naturally of type x. Second,
- string literals are arrays.)
-
- The syntax {...} is valid in an initializer for a named object of
- composite type.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-